Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Documenting all options of the FrameworkBundle #4121

Closed
wants to merge 3 commits into from

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Aug 14, 2014

Let's give one of the most forgotten dark places of the documentation some love :)

It's quite a difficult job, since I have to document lots of things I'm normally not very interested in (and thus do not know much about). So I hope the core team can help me verify the documentation in this PR. (cc @stof @jakzal)

Q A
Doc fix? yes
New docs? yes
Applies to 2.3+
Fixed tickets not sure

.. tip::

The XSD schema is available at
``http://symfony.com/schema/dic/symfony/symfony-1.0.xsd``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this XSD schema is not the XSD schema of the FrameworkBundle config. It is the XSD schema of the DI component (not the same XML namespace)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://symfony.com/schema/dic/services is the DI component, isn't it?

https://github.com/symfony/FrameworkBundle/blob/master/Resources/config/schema/symfony-1.0.xsd is in http://symfony.com/schema/dic/symfony/symfony-1.0.xsd

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right sorry

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good idea to link to the schema file on symfony.com since we may have different versions of it in the branches on GitHub but only one version on symfony.com?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schema is not retrieved by requesting the url. Symfony's Xml parser replaces the configured extension namespace with the file path returned from getXsdValidationBasePath().

The FrameworkExtension looks like:

class FrameworkExtension // ...
{
    // ...
    /** 
     * Returns the base path for the XSD files. 
     * 
     * @return string The XSD base path 
     */ 
    public function getXsdValidationBasePath() 
    { 
        return __DIR__.'/../Resources/config/schema'; 
    }. 

    public function getNamespace() 
    { 
        return 'http://symfony.com/schema/dic/symfony'; 
    } 
}

So http://symfony.com/schema/dic/symfony/symfony-1.0.xsd becomes path/to/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd which is the right schema in the right version

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know how the DependencyInjection handles schemas defined by a bundle. I was just referring to your tip. People might think that they can lookup the actual schema file under this url and that may confuse them.

@wouterj
Copy link
Member Author

wouterj commented Aug 14, 2014

Thanks for your time and feedback @stof!


<framework:config trusted-proxies="192.0.0.1, 10.0.0.0/8">
<!-- ... -->
</framework>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a complete valid XML file here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With complete I mean adding the "header". This way, you can copy the example without having to investigate the proper namespace and schema definition and so on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, this is broken. The closing tag should be </framework:config>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this is broken in all XML snippets


If set, the profiler will only be enabled when the current IP adres matches.

path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at Travis, this needs to get its own label to not be confused with fragments.path.

@xabbuh
Copy link
Member

xabbuh commented Nov 1, 2014

@wouterj Is there anything left to do (besides rebasing)?

@wouterj
Copy link
Member Author

wouterj commented Nov 1, 2014

@xabbuh not all options are documented. I'll work on this after I've done some big refactoring in the CmfMenuBundle.

@wouterj wouterj force-pushed the config_ref_framework branch from baa7579 to cca3ab0 Compare January 2, 2015 13:52
@wouterj
Copy link
Member Author

wouterj commented Jan 2, 2015

Wrong rebase + messy PR = new PR: #4736

@wouterj wouterj closed this Jan 2, 2015
@wouterj wouterj deleted the config_ref_framework branch January 2, 2015 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants